package com.buaa.xxx0321_1;

import android.app.ListActivity;
import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/3/25.
 */
public class Song2Activity extends ListActivity {

    private List<Song> data;
    public void init() {
        data = new ArrayList<Song>();
        Song s1 = new Song(100,"S1","content1",R.drawable.s1);
        Song s2 = new Song(100,"S2","content2",R.drawable.s2);
        Song s3 = new Song(100,"S3","content3",R.drawable.s3);
        data.add(s1);
        data.add(s2);
        data.add(s3);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
        SongAdapter adapter = new SongAdapter(this,data);
        setListAdapter(adapter);
    }
}
